import request from './request'

export const login = (query) => {
    return request({
        url: '/user/login',
        method: 'POST',
        data: query
    })
}
export const addUser = (query) => {
    return request({
        url: '/user/add',
        method: 'POST',
        data: query
    })
}
export const fetchAllUser = () => {
    return request({
        url: '/user/getAll',
        method: 'GET',
    })
}

export const updateUser = (query) => {
    return request({
        url: '/user/updateUser',
        method: 'POST',
        data: query
    })
}
export const deleteUser = (query) => {
    return request({
        url: `/user/removeUser/${query}`,
        method: 'DELETE',
    })
}
export const logout = (query) => {
    return request({
        url: '/user/logout',
        method: 'GET',
        data: query
    })
}

export const modifyPasswor = (password) => {
    return request({
        url: '/user/modify',
        method: 'POST',
        data: {
            'password':password
        }
    })
}

